package cn.netuo.bumbersoll;

/**
 * Created by GaQu_Dev on 2018/12/13.
 */
public class BizConstant {


    /** (用于测试)默认的-目标蓝牙服务 */
    public static final String DEFAULT_TARGET_BT_SERVICE_UUID           = "0000ffe0-0000-1000-8000-00805f9b34fb";
    /** (用于测试)默认的-目标蓝牙特征值 */
    public static final String DEFAULT_TARGET_BT_CHARACTERISTICS_UUID   = "0000ffe2-0000-1000-8000-00805f9b34fb";

    /** 参数-补丁版本 */
    public static final String SYS_PATCH_VERSION    = "1.3.1.13";

    /** 消息类型 - 推送广告 */
    public static final String CMD_TYPE_AD          = "ad";
    /** 消息类型 - 推送命令 */
    public static final String CMD_TYPE_ACT         = "act";
    /** 消息类型 - 请求重启 */
    public static final String CMD_TYPE_REBOOT      = "reboot";
    /** 消息类型 - 重置命令 */
    public static final String CMD_TYPE_RESETCMD    = "resetCmd";
    /** 消息类型 - 心跳 */
    public static final String CMD_TYPE_HEARTBEAT   = "heartbeat";
    /** 消息类型 - 自动执行命令 */
    public static final String CMD_TYPE_ACT_AUTO    = "act_auto";
    /** 消息类型 - 服务器请求心跳 */
    public static final String CMD_TYPE_REQUEST_HEARTBEAT   = "requestHeartbeat";
    /** 消息类型 - 解绑 */
    public static final String CMD_TYPE_UNBIND      = "unbind";
    /** 消息类型 - 设置媒体 */
    public static final String CMD_TYPE_VOL         = "vol";
    /** 消息类型 - (强制)目标版本 */
    public static final String CMD_TYPE_VERSION     = "version";

    /** 消息类型 - MQTT - 请求PAD供电 */
    public static final String REQUEST_NAME_PAD_POWERON             = "IO1_ON";     // 默认IO1给PAD1供电
    /** 消息类型 - MQTT - 定时PAD关电 */
    public static final String REQUEST_NAME_PAD_POWEROFF            = "IO1_OFF";    // 默认IO1给PAD1供电

    /** 消息类型 - MQTT - 请求USB供电(用于辨别是否是请求供电命令) */
    public static final String REQUEST_NAME_USB_POWERON             = "IO3_ON";     // 默认IO3给客户USB供电
    /** 消息类型 - MQTT - 定时USB自动关电 */
    public static final String REQUEST_NAME_AUTO_POWEROFF           = "IO3_OFF";    // 默认IO3给客户USB供电
    /** 消息类型 - MQTT - 请求USB供电(用于辨别是否是请求供电命令) */
    public static final String REQUEST_NAME_LIGHT_OFF               = "PWM1_00";     // 默认IO3给客户USB供电
    /** 消息类型 - MQTT - 定时USB自动关电 - 指令值 */
    public static String REQUEST_NAME_AUTO_POWEROFF_VALUE           = "E7F300";

    /** 广播-蓝牙配对 */
    public static final String  BROAD_BT_PARING         = "android.bluetooth.device.action.PAIRING_REQUEjkl'ST";

    /** 广播-Android开机完成 */
    public static final String  BROAD_BOOT_COMPLETED    = "android.intent.action.BOOT_COMPLETED";

    /** 广播-心跳 */
    public static final String  BROAD_HEARTBEAT         = "BS.broad.BROADCAST_HEARTBEAT";

    /** 参数-上次拉取广告时间(天) */
    public static final String  ARG_REFRESH_AD_DAY      = "BS.arg.REFRESH_AD_DAY";

    /** 广播-请求定位 */
    public static final String  BROAD_LOCATE            = "BS.broad.BROAD_LOCATE";

    /** 广播-业务心跳 */
    public static final String  BROAD_BIZ_HEARTBEAT     = "BS.broad.BROAD_BIZ_HEARTBEAT";

    /** 广播-检查MQTT连接状态 */
    public static final String  BROAD_MQTT_STATE        = "BS.broad.BROAD_MQTT_STATE";

    /** 广播-检查广告视频下载任务 */
    public static final String  BROAD_VIDEO_TASK        = "BS.broad.BROAD_VIDEO_TASK";

    /** 参数-进入退出节电模式 */
    public static final String  BROAD_LOW_POWER_CHANGED = "BS.broad.BROAD_LOW_POWER_CHANGED";


    /** 数据库名 */
    public static final String  ARG_DB_NAME             = "BumberSoll.db";

    /** 参数-是否每次完成操作之后关闭蓝牙 */
    public static boolean       IS_BT_KEPP_ON               = true;

    /** 参数-是否需要APP锁定前台 */
    public static boolean       IS_KEEP_FRONT               = true;

    /** 参数-当前是否处于节电模式 */
    public static boolean       IS_NOW_IN_LOWPOWER_MODE     = false;

    /** 参数-心跳间隔(秒) */
//    public static int           INTERVAL_HEARTBEATS         = 5;
    public static int           INTERVAL_HEARTBEATS         = 60 * 15;

    /** 参数-单次开电时长(毫秒) */
    public static final long    POWER_ON_PERIOD             = 1000 * 30 * 60;

    /** 参数-关电任务 */
    public static final String  OFF_USB_TASK_KEY            = "OFF_USB_TASK_KEY";

    /** 默认视频 */
    public static final String  DEFAULT_MOVIE            = "android.resource://" + App.getApp().getPackageName() + "/" + R.raw.movie;


//    /** 参数-剩余电量 */
//    public static int           POWER_LEFT                  = 0;
//    /** 参数-当前是否正在充电 */
//    public static boolean       POWER_CHARGING              = false;

    /** 参数-上次拉取定位的时间(天) */
    public static final String      ARG_REFRESH_LOCATE_DAY     = "BS.arg.REFRESH_LOCATE_DAY";
    /** 参数-定位-经度 */
    public static double        LOCATE_LAT                  = -1;
    /** 参数-定位-纬度 */
    public static double        LOCATE_LNG                  = -1;

    /** 参数-充电阈值-高 */
    public static int           BATTERY_MAX                 = 98;   // 98(建议)

    /** 参数-充电阈值-低 */
    public static int           BATTERY_MIN                 = 40;   // 40(建议)

    /** 参数-低电阈值 */
    public static int           BATTERY_LIMIT               = 20;   // 20(建议)


    // -----------------------------------------------------------HTTP
    /* 郭的本地 */
//    public static final String PROTOCOL = "http";
//    public static final String IP       = "192.168.11.21";
//    public static final String PORT     = "9123";

    /* 阿里云 */
    public static final String PROTOCOL = "http";
    public static final String IP       = "api.lvbuck.com";
    public static final String PORT     = "80";

    /** 获取区域信息 */
    public static final String GET_AREA_INFO        = PROTOCOL + "://" + IP + ":" + PORT + "/tys/hwadevicearea/list";

    /** 解绑 */
    public static final String GET_UNBIND           = PROTOCOL + "://" + IP + ":" + PORT + "/tys/unBind";

    /** 注册同时获得mqtt订阅主题 */
    public static final String POST_REGIST          = PROTOCOL + "://" + IP + ":" + PORT + "/tys/registerDevice";

    /** 用户扫的二维码的URL */
    public static final String GET_POWER_ON         = PROTOCOL + "://" + IP + ":" + PORT + "/tys/deviceAction?actionName=USER_POWER_ON&deviceId=";

    /** 检测进入配置界面 */
    public static final String GET_CHECK_PWD        = PROTOCOL + "://" + IP + ":" + PORT + "/tys/checkPwd";


    // -----------------------------------------------------------MQTT
    /** MQTT */
//    public static final String MQTT_HOST            = "ssl://192.168.11.172:8883";
    public static final String MQTT_HOST            = "tcp://129.211.88.122:1883";
    public static final String MQTT_UNAME           = "admin";
    public static final String MQTT_PWD             = "admin";


    /** MQTT-订阅的主题 */
    public static String        ARG_MQTT_TOPIC          = "";

    /** 发出的主题 */
//    public static final String  MQTT_SENDTOPIC          = "aaa";
    public static final String  MQTT_SENDTOPIC          = "tysReceipt";

    /** MQTT-订阅的主题-数据库-key */
    public static final String  ARG_MQTT_TOPIC_KEY      = "mqtt_topic_key";

    /** 蓝牙-目标蓝牙addr-key */
    public static final String  ARG_BLE_ADDR_KEY        = "ble_addr_key";

    /** 区域ID_key */
    public static final String  ARG_AREA_ID_KEY         = "ble_area_id_key";

    /** 业务ID_key */
    public static final String  ARG_BIZ_ID_KEY          = "ble_biz_id_key";

    /** 蓝牙是否常开_key */
    public static final String  ARG_IS_BT_KEPP_ON_KEY   = "ble_keep_on_key";

    /** APP是否保持前台_key */
    public static final String  ARG_IS_KEPP_FRONT_KEY   = "ble_keep_front_key";

    /** Bugly是否是开发设备(动态设定) */
    public static final String  ARG_BUGLY_IS_DEVELOP_DEV = "bugly_is_develop_dev";

    /** Bugly允许Log调试(动态设定, 须冷启动) */
    public static final String  ARG_BUGLY_ENABLE_LOG   = "bugly_enable_log";
}
